#region License, Terms and Conditions
//
// Prawks - Copyright (c) 2007 Atif Aziz. All rights reserved.
//
// This library is free software; you can redistribute it and/or modify it under
// the terms of the GNU Lesser General Public License as published by the Free
// Software Foundation; either version 2.1 of the License, or (at your option)
// any later version.
//
// This library is distributed in the hope that it will be useful, but WITHOUT
// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
// FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
// details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this library; if not, write to the Free Software Foundation, Inc.,
// 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 
//
#endregion

namespace Prawks.DbMethods
{
    using System;

    using SerializationInfo = System.Runtime.Serialization.SerializationInfo;
    using StreamingContext = System.Runtime.Serialization.StreamingContext;

    /// <summary>
    /// The exception that is thrown for data access methods.
    /// </summary>

    [ Serializable ]
    public class DbMethodException : ApplicationException
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="DbMethodException"/> class.
        /// </summary>
        
        public DbMethodException() {}

        /// <summary>
        /// Initializes a new instance of the <see cref="DbMethodException"/> class 
        /// with a specified error message.
        /// </summary>
        /// <param name="message">
        /// The error message that explains the reason for the exception.
        /// </param>
        
        public DbMethodException(string message) : base(message) {}

        /// <summary>
        /// Initializes a new instance of the <see cref="DbMethodException"/> class 
        /// with a specified error message and a reference to the inner exception 
        /// that is the cause of this exception.
        /// </summary>
        /// <param name="message">
        /// The error message that explains the reason for the exception.
        /// </param>
        /// <param name="innerException">
        /// The exception that is the cause of the current exception.
        /// </param>
        
        public DbMethodException(string message, Exception innerException) : 
            base(message, innerException) {}

        /// <summary>
        /// Initializes a new instance of the <see cref="DbMethodException"/> class 
        /// with serialized data.
        /// </summary>
        /// <param name="info">
        /// The object that holds the serialized object data.
        /// </param>
        /// <param name="context">
        /// The contextual information about the source or destination. 
        /// </param>
        
        protected DbMethodException(SerializationInfo info, StreamingContext context) :
            base(info, context) {}
    }
}
